package com.crm.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.crm.base.ResponseResult;
import com.crm.domain.dto.BusinessRecordDto;
import com.crm.domain.entity.BusinessRecord;
import com.crm.mapper.BusinessRecordMapper;
import com.crm.service.IBusinessRecordService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 沟通记录表 服务实现类
 * </p>
 *
 * @author Hulunico
 * @since 2024-08-08
 */
@RequiredArgsConstructor
@Service
public class BusinessRecordServiceImpl extends ServiceImpl<BusinessRecordMapper, BusinessRecord> implements IBusinessRecordService {
    private final BusinessRecordMapper businessRecordMapper;

    @Override
    public ResponseResult add(BusinessRecordDto dto) {
        BusinessRecord businessRecord = BeanUtil.copyProperties(dto, BusinessRecord.class);
        businessRecordMapper.insert(businessRecord);
        return ResponseResult.success();
    }

}
